UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bu7AwzqrmgCLXCgYoiOXd5RZeZxKa1scVqYGcdjxIhA=' 
WHERE 
  key_id = '4fa3741bd0610ecb4c75d7a5ffe221c7d86e79da9b4e7a40d7ec6e71d4279fc6' 
  AND (
    token = 'bu7AwzqrmgCLXCgYoiOXd5RZeZxKa1scVqYGcdjxIhA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046