UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HlikQiXQV4PVclZ6j5aUgDg/jEaTIbfiCRoxoiuAvlU=' 
WHERE 
  key_id = '4bbd0c83bf32bcc9d04fec2171bb313bedbb057dab3e1ad90f1ff0adb7880c06' 
  AND (
    token = 'HlikQiXQV4PVclZ6j5aUgDg/jEaTIbfiCRoxoiuAvlU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050