UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RLIauD77OMAeP/O8L6jefHlY6MpuWViFO6JT+RzWXwk=' 
WHERE 
  key_id = 'c8063c3254df2e28f2a8dccee638a168e0f95a8255a0a90f8ae014f60c875fa9' 
  AND (
    token = 'RLIauD77OMAeP/O8L6jefHlY6MpuWViFO6JT+RzWXwk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033