UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fPYnrNwlEWYclDHkiqDxk0p6gZ/ygPpBaiLdfmF6P6A=' 
WHERE 
  key_id = '3b57ada9d6c278b733ecb4ff7666545dca937a17162a6d38b53aefb6b8094fd4' 
  AND (
    token = 'fPYnrNwlEWYclDHkiqDxk0p6gZ/ygPpBaiLdfmF6P6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029