UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zTAYNb5DRVMtsjZh/RjUmPHk5e9r+ZWPaOfFF+9oAVw=' 
WHERE 
  key_id = '89a9106b6fe955baba719b18c763fb73c8191f0859899ec82503fceaf35c211f' 
  AND (
    token = 'zTAYNb5DRVMtsjZh/RjUmPHk5e9r+ZWPaOfFF+9oAVw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015