UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2Q1BkvPg+H14OVojxCOfkFUnRUn+RbfDM4bMHT1Ie6o=' 
WHERE 
  key_id = 'd7cca04debd2f7facc6f1002d14ce48229dd36551d63eeac6c08480cf154892f' 
  AND (
    token = '2Q1BkvPg+H14OVojxCOfkFUnRUn+RbfDM4bMHT1Ie6o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031