UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5OOQBzDxtWSH5p8yxLBVibNMm2sJ1v43BIskJVF5G84=' 
WHERE 
  key_id = 'a46f6188338f2dacb524ad3ab84e8def28e942771c72fd1b061240313e75c7ff' 
  AND (
    token = '5OOQBzDxtWSH5p8yxLBVibNMm2sJ1v43BIskJVF5G84=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042