UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XF0U80Otx2Q8aLW6lBBKfwESO6HPJ3DK2GBKLzU9//4=' 
WHERE 
  key_id = 'd8615540003152138f00e705e731678ec7d037f527e4ab946c9501e5ed7d7e20' 
  AND (
    token = 'XF0U80Otx2Q8aLW6lBBKfwESO6HPJ3DK2GBKLzU9//4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00072