UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '20gpg+/AU+Nk3QMVjP2CbNv+1tgV8tkO++OSoBP9s90=' 
WHERE 
  key_id = '5d7028b127f6d402835ca4b74c1bf3e34be87a44b74a98261fe8058d340f6a57' 
  AND (
    token = '20gpg+/AU+Nk3QMVjP2CbNv+1tgV8tkO++OSoBP9s90=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054