UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AJAK2uLzKCrjGJTt71pNHpN/CBOkCKIM/6DvOwE4KLs=' 
WHERE 
  key_id = 'd5a068285bd2855e2027246f7a748ae36665306555ab2957d0fb26fbdd6633c7' 
  AND (
    token = 'AJAK2uLzKCrjGJTt71pNHpN/CBOkCKIM/6DvOwE4KLs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034