UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PR9TY5qPwA/oETcHD/ilAYNkJx+0kD2vRmAWL3DUYI4=' 
WHERE 
  key_id = 'de94f9633ee13df152d7e000e905d8eb034fd73ea1b76158e87f209330ce297e' 
  AND (
    token = 'PR9TY5qPwA/oETcHD/ilAYNkJx+0kD2vRmAWL3DUYI4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019