UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wJBWBNP5r/Btae2phe1ndop3tfnArlfQ4X1shTM07lU=' 
WHERE 
  key_id = '0192e2f2c586cfb59ad21f77a552dd4e9fba470987bd1c77360c6c9fa6c70230' 
  AND (
    token = 'wJBWBNP5r/Btae2phe1ndop3tfnArlfQ4X1shTM07lU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041