UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ODxdZXH0VWtE2pRp0t4RDkPtmAMybC04DOPswMGjveg=' 
WHERE 
  key_id = 'b28802edf2b2b244af0f123fc9488593f2e4ff66ae2ac4aeb19c67a1d99f5ba8' 
  AND (
    token = 'ODxdZXH0VWtE2pRp0t4RDkPtmAMybC04DOPswMGjveg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024