UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tj95MFx6rMh/BOX/gD6nNyjm40SeVvP+r8HaLSKgtMw=' 
WHERE 
  key_id = '3be5f6372976c7f07d1016ddf0a2e025efc8e7db3e451210c94cd31ea6423eef' 
  AND (
    token = 'Tj95MFx6rMh/BOX/gD6nNyjm40SeVvP+r8HaLSKgtMw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034