UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KKljDJBBqmKqVlkwvN33S3yFyKo4zD5bqIIyscaVkv4=' 
WHERE 
  key_id = '7e13b382175c09d9322400a42627474a547c7a2ca073363f149c3cc3e8b4809c' 
  AND (
    token = 'KKljDJBBqmKqVlkwvN33S3yFyKo4zD5bqIIyscaVkv4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031