UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gPC/ASHdJGJC0XNqqKBCx6U56k+xEHm+lhVVZWwU7PQ=' 
WHERE 
  key_id = 'a9bc3e32f2a95ad5b812b89a6d27dd3feaf07f193937f3fb500a4f40f0458e96' 
  AND (
    token = 'gPC/ASHdJGJC0XNqqKBCx6U56k+xEHm+lhVVZWwU7PQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030