UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QZ2qGw83VIlBsTeXZJbRu2uuJDXsymbJsz/HLXq7fpQ=' 
WHERE 
  key_id = '1b3ffb24ccbf7292adceec56e14753244054408328a3edce426136b011478a6f' 
  AND (
    token = 'QZ2qGw83VIlBsTeXZJbRu2uuJDXsymbJsz/HLXq7fpQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019