UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6+L28ZnuedHNpSz7Bg0AB05Ct0Af4dXqpk3wkDRNK6o=' 
WHERE 
  key_id = '4b73a6cbea4a6cce1d2838a0eb82108c7886f0ddc72ca5991909911460322655' 
  AND (
    token = '6+L28ZnuedHNpSz7Bg0AB05Ct0Af4dXqpk3wkDRNK6o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00130