UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HBd445JJ+5kD/G6QRdmZd4Xe4rFNgN0Vn0uBbiIr8zo=' 
WHERE 
  key_id = '7c55d5df114d8a8c05d607cf6b4acd85053a6f9fe8004241cdf5cbba7b39bef6' 
  AND (
    token = 'HBd445JJ+5kD/G6QRdmZd4Xe4rFNgN0Vn0uBbiIr8zo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019