UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zt+/2UWVZ3NXKoRABzx2N4YBHYpgPbTTnYXX/IUwQBM=' 
WHERE 
  key_id = 'ff8cf01bd160a84bbfda73dfd28ab2b40737d7ab30601bb2304279c48022c4a5' 
  AND (
    token = 'Zt+/2UWVZ3NXKoRABzx2N4YBHYpgPbTTnYXX/IUwQBM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028