UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LB2sSpVuYS9Mapg0E2oqGzQCDMgkoj73v0pcH6YE7dU=' 
WHERE 
  key_id = '62067ef6e042e3fb7f4d8ed9b7becddffc0faf72dd503f27ce206c44f7de8e40' 
  AND (
    token = 'LB2sSpVuYS9Mapg0E2oqGzQCDMgkoj73v0pcH6YE7dU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035