UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e7ZMd7sKqHBwiwwr6dTvaK6uLS5Xx/3gnxpEHcHIx58=' 
WHERE 
  key_id = 'fed70f53186d67388c78e44f6d2e133024a569eb3b522699430cca1dcdaece76' 
  AND (
    token = 'e7ZMd7sKqHBwiwwr6dTvaK6uLS5Xx/3gnxpEHcHIx58=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031