UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UtccacC7ZDI7cgxI2JQWN5V7rhmJhXW9rQuJCvNgKJc=' 
WHERE 
  key_id = '16381c01b51fa7e29a2ddf44b67270b47ba2ea253ddfe3378dd96ddf1058d4ad' 
  AND (
    token = 'UtccacC7ZDI7cgxI2JQWN5V7rhmJhXW9rQuJCvNgKJc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031