UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9tPwRxrepdxsXP1w7c1cFNKmYOiyNO9oPSDuyUz9b7Q=' 
WHERE 
  key_id = '804bf09283a4eb404ddcba07a00c3eb74111a62fe77c5f6494af2155e7c51bb6' 
  AND (
    token = '9tPwRxrepdxsXP1w7c1cFNKmYOiyNO9oPSDuyUz9b7Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026