UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k/ybRw29Hlo383Ybv58b6HdU6L6Vj+cd8h1JUpns7ZY=' 
WHERE 
  key_id = '241fc34a13cb6c3df75f7534fde3d502c46a8074aa824b351b4c37d7bded435c' 
  AND (
    token = 'k/ybRw29Hlo383Ybv58b6HdU6L6Vj+cd8h1JUpns7ZY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046