UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8lvkZd0Di5XiDoXPz+rQmMIabbxM8KmkGosfQFYDDCM=' 
WHERE 
  key_id = '6192ee2a4ea5b59c0a4f1ca898ad650a1927cc61d2e143f79a8d0d0377dbe656' 
  AND (
    token = '8lvkZd0Di5XiDoXPz+rQmMIabbxM8KmkGosfQFYDDCM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053