UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5XIwiuPhTAspzBiDKJ/44Inp2LEYTyrKgYSux9Qyri0=' 
WHERE 
  key_id = '90d45a4519c951d717d8391f1c986fcd3074a5ee1b10ac794edfedbb3411da84' 
  AND (
    token = '5XIwiuPhTAspzBiDKJ/44Inp2LEYTyrKgYSux9Qyri0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033