UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qf9TKGRFiramvrpR5+2DvCxJCMEJvaNEolGPsKW/cCw=' 
WHERE 
  key_id = 'f0a4a018476bdaa7c8c83fced76a0da06ddd13e42c5f8566a498a4cc8ba5377a' 
  AND (
    token = 'Qf9TKGRFiramvrpR5+2DvCxJCMEJvaNEolGPsKW/cCw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028