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

Query time 0.00043