UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j4I5KT7Ly/bdQ7wXdVCYkXLAuW/ajp+EzRpbqNsIz7U=' 
WHERE 
  key_id = '94ef2376b26c6a14f48a2ef118e54cfd3f556f9a71e6580e04e530de871f7e6a' 
  AND (
    token = 'j4I5KT7Ly/bdQ7wXdVCYkXLAuW/ajp+EzRpbqNsIz7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035